import java.util.Arrays;

public class Solution806 {
    public int[] numberOfLines(int[] widths, String s) {
        int line=1,cur=0;
        for (char c : s.toCharArray()) {
            if (cur+widths[c-'a']>100){
                line++;
                cur=widths[c-'a'];
            }else{
                cur+=widths[c-'a'];
            }
        }
        return new int[]{line,cur};
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new Solution806().numberOfLines(new int[]{10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}, "abcdefghijklmnopqrstuvwxyz")));
    }
}
